package com.eternal.framework.binding.viewadapter.toolbar;

import androidx.databinding.BindingAdapter;
import androidx.appcompat.widget.Toolbar;
import android.view.View;

import com.eternal.framework.binding.command.BindingCommand;

/**
 * @author li
 */
public class viewAdapter {
    @BindingAdapter(value = {"onNavClick"})
    public static void onNavigationClick(Toolbar toolbar, final BindingCommand<Void> command){
        toolbar.setNavigationOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                command.execute();
            }
        });
    }
}
